﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class LogController : MonoBehaviour {
    public void ToNetScene()
    {
        SceneManager.LoadScene(2);
    }
    [Header("音量按钮图集")]
    public Sprite Mysprit;
    [Header("默认的图集")]
    private Sprite Defallsprit;
    [Header("音量按钮")]
    public Button source;
    private AudioSource su;
    public int sourceValue = 1;
    public void SetSourceButton()
    {
        sourceValue = -sourceValue;
        if (sourceValue == -1)
        {
            source.image.sprite = Mysprit;
        }
        else if (sourceValue == 1)
        {
            source.image.sprite = Defallsprit;
        }
    }
    [Header("帮助界面")]
    public GameObject HelpPanel;
    public void ShowHelpPanel()
    {
        HelpPanel.gameObject.SetActive(true);
    }
    public void HideHelpPanel()
    {
        HelpPanel.gameObject.SetActive(false);
    }
    // Use this for initialization
    void Start () {
        Defallsprit = source.image.sprite;
        su = GetComponent<AudioSource>();
    }
	
	// Update is called once per frame
	void Update () {
        if (sourceValue == -1)
        {
            su.mute = true;
        }
        else
        {
            su.mute = false;
        }
    }
}
